package com.zhsource;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;
import org.springframework.data.mongodb.core.mapping.FieldType;
import org.springframework.stereotype.Component;


/**
 * <p>@ClassName：MongoArticle
 * <p>@Date 2023/10/29  16:28
 *
 * @Author zzl
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Document(collection = "mongoArticle" )
public class MongoArticle {
    @Id // 代表此字段是mongodb自己的自增id字段
    private String _id;

    private Long id;

    @Field(name = "name", targetType = FieldType.STRING)
    private String articleName;
}
